<?php
class Warehouse_model extends CI_Model
{
	public $tbl = 'warehouse';

	public function __contruct()
	{
		parent::__construct();	
	}

	public function All($companyId)
	{
		$queryString = "SELECT * FROM $this->tbl WHERE companyId = $companyId";

		$query = $this->db->query($queryString);
		
		return $query->result();
	}

	public function Add($companyId)
	{
		$data = array(
			'Name' => $this->input->post('Name'),
			'Address' => $this->input->post('Address'),
			'Phone' => $this->input->post('Phone'),
			'CompanyId' => $companyId
			);

		return $this->db->insert($this->tbl, $data);
	}	
}
?>